public class Main {
    public static void main(String[] args) {
        int i = 0;
        int a = 0;
        int b = 0;
        int c = 0;
        for (i = 0; i <= 999; i++) {
            a = i % 10;
            b = (i/10) % 10;
            c = i/100;
            if(i == a*a*a+b*b*b+c*c*c){
                System.out.println(i);
            }
        }
    }
}
